package com.project.im.sdk.controller;

import com.project.im.app.request.AuthRequest;
import com.project.im.app.response.AuthResponse;
import com.project.im.app.vo.ResponseVO;
import com.project.im.common.annotation.Log;
import com.project.im.sdk.service.AuthService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "认证管理")
@RestController
@RequestMapping("/api/v1")
@RequiredArgsConstructor
public class AuthApiController {

    private final AuthService authService;

    @Log("认证管理-鉴权")
    @Operation(summary = "鉴权")
    @PostMapping("/auth")
    public ResponseVO<AuthResponse> auth(@RequestBody AuthRequest authRequest) {
        return ResponseVO.success(authService.auth(authRequest));
    }

}
